package com.adjaisd.scarecrow.service;

import com.adjaisd.scarecrow.dto.DeviceInfoDTO;
import com.adjaisd.scarecrow.dto.QuotaAllInfo;
import com.adjaisd.scarecrow.dto.QuotaDTO;
import com.adjaisd.scarecrow.entity.Alarm;
import com.adjaisd.scarecrow.vo.Pager;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author adjaisd
 * @since 2022-03-28
 */
public interface AlarmService extends IService<Alarm> {

    // 获取某指标下的所有告警设置
    List<Alarm> getAlarmListByQId(long quotaId);

    // 根据指标判断告警信息
    Alarm verifyQuota(QuotaDTO quotaDTO);

    // 告警信息封装
    DeviceInfoDTO verifyDeviceInfo(DeviceInfoDTO deviceInfoDTO);

    // 根据用户ID获取报警列表
    List<Alarm> getAlarmListByUID(long userId);

    boolean existAlarmByQID(Long id);

    Alarm getAlarm(Long quotaId, String name, String operator);

    // 添加报警
    boolean addAlarm(Alarm alarm);

    boolean delAlarm(Long quotaId, String name, String operator);

    // 查询报警日志
    Pager<QuotaAllInfo> queryAlarmLogByUID(Long userId, Long page, Long pageSize, String start, String end, String alarmName, String deviceId);

}
